package com.gyc.basics.test;

/**
 * @author gyc
 * @date 2017/12/27
 * 实现字符串反转（递归思想）
 */
public class StringReversal {
    public static String reversr(String begin){
        if(begin == null || begin.length()<=1){
            return  begin;
        }
        return reversr(begin.substring(1))+begin.charAt(0);
    }
    public static void main(String[] args){
        System.out.println(reversr("abcdefg"));
    }
}
